package day005.stagetest;

public class Test03 {
    public static void main(String[] args) {
        System.out.println("符合条件的四位数为：");
        int count = 0;
        for (int i = 9999; i > 999; i--) {
            int ge = i % 10;
            int shi = i / 10 % 10;
            int bai = i / 100 % 10;
            int qian = i / 1000 % 10;
            if (ge + bai == shi + qian) {
                System.out.print(i + " ");
                count++;
            }
        }
        System.out.println();
        System.out.println("这样的四位数有：" + count + "个");
    }
}
